#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from datetime import datetime
import os

# pwd = os.path.abspath('.')
# print(pwd)
#
# print('           size       last modified     name')
# print('--------------------------------------------')
# for f in os.listdir(pwd):
#     fsize = os.path.getsize(f)
#     mtime = datetime.fromtimestamp(os.path.getmtime(f)).strftime('%Y-%m-%d %H:%M')
#     flag = '/' if os.path.isdir(f) else ''
#     print('%10d %s %s%s' %(fsize,mtime,f,flag))

def search(key,dir):
    for value in os.scandir(dir):
        newpath = os.path.join(dir,value.name)
        if os.path.isfile(value):
            if key in value.name:
                print(os.path.relpath(newpath,a))
            elif os.path.isdir(value):
                search(x.newpath)
a = os.getcwd()
b = input('key')
search(b,a)
